<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>管理员查看</title>
<script type="text/javascript" src="<%=basePath%>skin/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/jquery.tools.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/common.js"></script>
<script language="javascript">
	 $().ready(function(){
		 <c:forEach items="${admin.roles }" var="role">
		 	var value = "${role.id}";
		 	$("input:checkbox[name=roleIds]").each(function(){
		 		var roleId = $(this).val();
		 		if(roleId == value){
		 			$(this).attr("checked","true");
		 		}
		 	});
		 </c:forEach>
	 });
</script>
</head>

<body>
	<ul id="tab" class="tab">
		<li><input type="button" value="基础信息" /></li>
		<li><input type="button" value="个人资料" /></li>
	</ul>
	<table width="98%" class="input tabContent">
		<tr bgcolor="#FAFAF1" height="22">
			<td class="tdRight">用户名：</td>
			<td class="tdLeft">${admin.username}</td>
		</tr>
		<tr bgcolor="#FAFAF1" height="22">
			<td class="tdRight">E-mail：</td>
			<td class="tdLeft">${admin.email}</td>
		</tr>
		<tr bgcolor="#FAFAF1" height="22">
			<td class="tdRight">手机：</td>
			<td class="tdLeft">${admin.mobile}</td>
		</tr>
		<tr bgcolor="#FAFAF1" height="22">
			<td class="tdRight">是否启用：</td>
			<td class="tdLeft"><input type="checkbox" id="isEnabled" name="isEnabled" value="true" <c:if test="${admin.isEnabled }">checked</c:if> disabled/></td>
		</tr>
		<tr bgcolor="#FAFAF1" height="22">
			<td class="tdRight">角色：</td>
			<td class="tdLeft">
				<c:forEach items="${roles }" var="role">
					<input type="checkbox" name="roleIds" value="${role.id }" disabled/> ${role.name }<br/>
				</c:forEach>
			</td>
		</tr>
	</table>
	<table width="98%" class="input tabContent">
		<tr bgcolor="#FAFAF1" height="22">
			<td class="tdRight">部门：</td>
			<td class="tdLeft">${admin.department }</td>
		</tr>
		<tr bgcolor="#FAFAF1" height="22">
			<td class="tdRight">姓名：</td>
			<td class="tdLeft">${admin.name }</td>
		</tr>
	</table>
	<table width="98%">
		<tr bgcolor="#EEF4EA">
			<td height="36" colspan="10">
				<input type="button" value="返回" class="button" onclick="location.href='<%=basePath%>admin/admin/list.shtml'" >
			</td>
		</tr>
	</table>
</body>
</html>
